/**
 * @date 1:39:06 PM
 * EducationMessageController.java
 * Administrator
 * TODO
 */
package com.qs.education.controller;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.qs.education.bean.api.PageBean;
import com.qs.education.bean.api.ResponseBean;
import com.qs.education.service.IMessageAPPService;
/**
 * @class EducationMessageController	
 * @author Warren
 * @description
 * @date Nov 9, 2018 
 */
@RestController
public class EducationMessageController {

	@Autowired
	private IMessageAPPService iMessageAPPService;
	private final Logger log = Logger.getLogger(this.getClass());
	
	/**
	 * @author Warren
	 * @param studentId
	 * @param currentPage
	 * @param pageSize
	 * @return PageBean
	 * @description 根据页码、页数量、id查询学生的消息列表
	 * @date Nov 21, 2018
	 */
	@RequestMapping("/message/getALLMessageByStudentId")
	public PageBean getALLMessageByStudentId(Long studentId,@RequestParam(defaultValue="1")int currentPage,@RequestParam(defaultValue="10")int pageSize) {
		log.info("app");
		PageBean pageBean = iMessageAPPService.getALLMessageByStudentId(studentId, currentPage, pageSize);
		return pageBean;
	}
	
	/**
	 * @author Warren
	 * @param teacherId
	 * @param currentPage
	 * @param pageSize
	 * @return PageBean
	 * @description 根据页码、页数量、id查询教师的消息列表
	 * @date Nov 21, 2018
	 */
	@RequestMapping("/message/getALLMessageByTeacherId")
	public PageBean getALLMessageByTeacherId(Long teacherId,@RequestParam(defaultValue="1")int currentPage,@RequestParam(defaultValue="10")int pageSize){
		log.info("app");
		PageBean pageBean = iMessageAPPService.getALLMessageByTeacherId(teacherId, currentPage, pageSize);
		return pageBean;
	}
	
	/**
	 * @author Warren
	 * @return ResponseBean
	 * @description 根据id删除消息
	 * @date Nov 20, 2018
	 */
	@RequestMapping("/message/deleteMessageById")
	public ResponseBean deleteMessageById(Long id) {
		log.info("app");
		ResponseBean responseBean = iMessageAPPService.deleteMessageById(id);
		return responseBean;
	}
}
